﻿using System;
using System.IO;
using System.Text.RegularExpressions;

namespace _11.DeleteTestPrefixWords
{
    class DeleteTestPrefixWords
    {
        static void Main()
        {
            string text = "";
            using (StreamReader reader = new StreamReader("Text.txt"))
            {
                string line = reader.ReadLine();
                while (line != null)
                {
                    text += Regex.Replace(line, @"\btest\w*\b", String.Empty) + "\r\n";
                    line = reader.ReadLine();
                }
            }
            using (StreamWriter writer = new StreamWriter("Text.txt"))
            {
                writer.Write(text);
            }
        }
    }
}
